<header id="order_tab_summary" data-hook>
  <dl class="additional-info">
    <dt id="order_status" data-hook><%= Spree.t(:status) %>:</dt>
    <dd><span class="state <%= @order.state %>"><%= Spree.t(@order.state, :scope => :order_state) %></span></dd>

    <% if @order.user.present? %>
      <dt data-hook='admin_order_user_link'><%= Spree.t(:user) %>:</dt>
      <dd id='order_user_link'><%= link_to @order.user.email, spree.edit_admin_user_path(@order.user) %></dd>
    <% end %>

    <dt data-hook='admin_order_tab_subtotal_title'><%= Spree::Order.human_attribute_name(:item_total) %>:</dt>
    <dd id='item_total'><%= @order.display_item_total.to_html %></dd>
    <% if checkout_steps.include?("delivery") && @order.ship_total > 0 %>
      <dt data-hook='admin_order_tab_ship_total_title'><%= Spree::Order.human_attribute_name(:shipment_total) %>:</dt>
      <dd id='ship_total'><%= @order.display_ship_total.to_html %></dd>
    <% end %>

    <% if @order.included_tax_total != 0 %>
      <dt data-hook='admin_order_tab_included_tax_title'><%= Spree::Order.human_attribute_name(:included_tax_total) %>:</dt>
      <dd id='included_tax_total'><%= @order.display_included_tax_total.to_html %></dd>
    <% end %>

    <% if @order.additional_tax_total != 0 %>
      <dt data-hook='admin_order_tab_additional_tax_title'><%= Spree::Order.human_attribute_name(:additional_tax_total) %>:</dt>
      <dd id='additional_tax_total'><%= @order.display_additional_tax_total.to_html %></dd>
    <% end %>

    <dt data-hook='admin_order_tab_total_title'><%= Spree::Order.human_attribute_name(:total) %>:</dt>
    <dd id='order_total'><%= @order.display_total.to_html %></dd>

    <% if @order.completed? %>
      <dt><%= Spree::Shipment.model_name.human %>: </dt>
      <dd id='shipment_status'><span class="state <%= @order.shipment_state %>"><%= Spree.t(@order.shipment_state, :scope => :shipment_states, :default => [:missing, "none"]) %></span></dd>
      <dt><%= Spree::Payment.model_name.human %>: </dt>
      <dd id='payment_status'><span class="state <%= @order.payment_state %>"><%= Spree.t(@order.payment_state, :scope => :payment_states, :default => [:missing, "none"]) %></span></dd>
      <dt data-hook='admin_order_tab_date_completed_title'><%= Spree::Order.human_attribute_name(:completed_at) %>:</dt>
      <dd id='date_complete'><%= pretty_time(@order.completed_at) %></dd>
    <% end %>

    <% if @order.approved? %>
      <dt><%= Spree::Order.human_attribute_name(:approver) %></dt>
      <dd><%= @order.approver.try(:email) || @order.approver_name %></dd>
      <dt><%= Spree::Order.human_attribute_name(:approved_at) %></dt>
      <dd><%= pretty_time(@order.approved_at) %></dd>
    <% end %>

    <% if @order.canceled? && @order.canceler && @order.canceled_at %>
      <dt><%= Spree::Order.human_attribute_name(:canceler) %></dt>
      <dd><%= @order.canceler.email %></td>
      <dt><%= Spree::Order.human_attribute_name(:canceled_at) %></dt>
      <dd><%= pretty_time(@order.canceled_at) %></dd>
    <% end %>
  </dl>
</header>
